#ifndef MOTORSTATESENSOR_H
#define MOTORSTATESENSOR_H

class MotorStateSensor;

#include "../Systems/abstractsystem.h"
#include<QObject>
#include <QTimer>
#include <QList>

class MotorStateSensor: public QObject
{
    Q_OBJECT

public:
    MotorStateSensor(AbstractSystem *a_sys, int a_id, int freq, double a_delay=0, double a_imprecision=0);
    double getValue();

public slots:
    void update();

private:
    AbstractSystem *sys;
    int id;
    double dt, imprecision;
    int delay;

    double value;
    QTimer *timer;
    QList<double> storedValues;
    static int counter;
};

#endif // MOTORSTATESENSOR_H
